package org.example.partition;

import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

public class PartitionDemo {
    public static void main(String[] args) throws Exception {

        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(3);
//        env.fromElements(1,2,3,4,5,6,7,8,9,10).shuffle().print();
//        env.fromElements(1,2,3,4,5,6,7,8,9,10).rebalance().print();
//        env.fromElements(1,2,3,4,5,6,7,8,9,10).broadcast().print();
        env.fromElements(1,2,3,4,5,6,7,8,9,10).global();
//        env.fromElements(1,2,3,4,5,6,7,8,9,10).map(x->x).setParallelism(2).rescale().print().setParallelism(4);
        env.execute();
    }
}
